```python import pandas as pd import altair as alt from vega_datasets import data locations_table = pd.read_csv(r"https://raw.githubusercontent.com/SwanseaU-TTW/csc337_coursework1/master/pleiades-locations-latest.csv") pd.set_option('display.max_columns', None) alt.data_transformers.disable_max_rows() locations_table.head() countries = alt.topo_feature(data.world_110m.url, 'countries') selector = alt.selection_single(empty='all', fields=['featureType']) colours_condition = alt.condition(selector,'featureType:N',alt.value('#666666')) # Used world cropping map of World inspired from https://stackoverflow.com/questions/61135952/vega-lite-altair-how-to-center-or-crop-a-map-of-europe background = alt.Chart(countries).mark_geoshape( fill='#666666', stroke='white' ).project( type= 'mercator', scale= 155, # Magnify center= [50,27], # [lon, lat] ).properties( title='World (Mercator)', ) binned_heatmap = alt.Chart(locations_table).mark_rect( fillOpacity=0.5 ).encode( alt.X('reprLong:Q', bin=alt.Bin(maxbins=60)), alt.Y('reprLat:Q', bin=alt.Bin(maxbins=60)), alt.Color('count(featureType):Q', scale=alt.Scale(scheme='greenblue')), ).properties( title='World (Mercator)', ) background + binned_heatmap ```
```python ```